package com.dhl.config;

import com.dhl.annotation.Component;
import com.dhl.aware.BeanNameAware;
import com.dhl.init.BeanPostProcessor;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

/**
 * @author danghailiang
 * @date 2023年01月16日 18:59
 */
//@Component
public class TestAnnotation implements BeanPostProcessor {

    public Object postProcessBeforeInitialization(final Object bean, String beanName) {
        if(bean instanceof BeanNameAware){
            ((BeanNameAware) bean) .beanName(beanName);
            System.out.println("beanName::::"+beanName);
        }
        return bean;
    }
}
